﻿using System;
using System.Linq;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
using Microsoft.LightSwitch;
using Microsoft.LightSwitch.Framework.Client;
using Microsoft.LightSwitch.Presentation;
using Microsoft.LightSwitch.Presentation.Extensions;

namespace LightSwitchApplication
{
    public partial class ShopDetail
    {
        partial void Shop_Loaded(bool succeeded)
        {
            // Write your code here.
            this.SetDisplayNameFromEntity(this.Shop);
        }

        partial void Shop_Changed()
        {
            // Write your code here.
            this.SetDisplayNameFromEntity(this.Shop);
        }

        partial void ShopDetail_Saved()
        {
            // Write your code here.
            this.SetDisplayNameFromEntity(this.Shop);
        }

        partial void SalesOrdersAddAndEditNew_CanExecute(ref bool result)
        {
            // Write your code here.

        }

        partial void SalesOrdersAddAndEditNew_Execute()
        {
            this.Application.ShowCreateNewSalesOrder();
        }

        partial void SalesOrdersEditSelected_CanExecute(ref bool result)
        {
            // Write your code here.

        }

        partial void SalesOrdersEditSelected_Execute()
        {
            if (this.SalesOrders.SelectedItem != null)
                this.Application.ShowSalesOrderDetail(this.SalesOrders.SelectedItem.Id);
        }

        partial void ShopDetail_Activated()
        {
            this.DisplayName = this.ShopId.ToString() + " (Магазин)";

        }

        partial void ShowAuditHistory_Execute()
        {
            this.Application.ShowAuditLogHistory("Магазины", this.ShopId);
        }
    }
}